#ifndef __BSP_RINGBUFF_H__
#define __BSP_RINGBUFF_H__

#include "stdint.h"
#include "msg_port_config.h"

#define RINGBUFFSIZE 			(MSG_PORT_NUM)

typedef struct _ringBuffPage
{
	uint16_t 	size;
	void 	 	*buff;
}ringBuffPage_t;

typedef struct _ringBuffPort
{
	uint16_t length;
	uint16_t head_index;
	uint16_t tail_index;
	
	ringBuffPage_t *(pages)[RINGBUFFSIZE];

}ringBuffPort_t;

void 		ringBuff_init(ringBuffPort_t *Port);
uint8_t ringBuff_noEmpty(ringBuffPort_t *Port);
uint8_t ringBuff_noFull(ringBuffPort_t *Port);
uint16_t ringBuff_getSize(ringBuffPort_t *Port);
uint8_t ringBuff_enqueue(ringBuffPort_t *Port,void *Data,uint16_t Size);
uint8_t ringBuff_dequeue(ringBuffPort_t *Port,void *Data,uint16_t *Size);


#endif
